class Invoice < ActiveRecord::Base
  belongs_to :customer
  # has_and_belongs_to_many :orders,  :join_table => :orders_invoices
  has_many :orders_invoices
  has_many :orders, :through => :orders_invoices
  
  
  accepts_nested_attributes_for :orders_invoices
  
  
  #====== validations =========
  validates_presence_of :customer_id
  
end
